import java.util.Scanner;

public class demo020 {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        double[][] arr=new double[30][5];
        int i=0;
        while(i<30) {
            for(int j=0;j<5;j++) {
                System.out.println("请输入第"+(i+1)+"学生的第"+(j+1)+"门成绩");
                arr[i][j]=scan.nextDouble();
            }

            System.out.println("请问你是否需要继续输入Y/N");
            char o=scan.next().charAt(0);
            if(o=='Y') {
                i++;
            }
            else {
                break;
            }
        }
        for (int j = 0; j <=i; j++) {
            double sum=0;
            for (int n = 0; n < 5; n++) {
                sum+=arr[j][n];
            }
            System.out.println("总共"+(j+1)+"名学生的总成绩为"+sum);
        }

    }
}
